package netty.rpc.framework.core.netty.transport.server;

import lombok.NonNull;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author guiyiqiao
 * @date 2020/12/11
 */
public class ServiceProvider {
    private static Map<String,Object> serviceMap = new ConcurrentHashMap<>();

    public Object getService(@NonNull String serviceName){
        return serviceMap.get(serviceName);
    }

    public void addService(@NonNull String serviceName,@NonNull Object service){
        serviceMap.put(serviceName,service);
    }
}
